package com.machinecontroller.utils;

import android.text.TextUtils;

import com.google.gson.Gson;

/**
 * Created by zhangxuehui on 2017/12/24.
 */

public class GsonUtil {
    public static <T> T praseModel(String s, Class<T> cls) {
        Gson gson = new Gson();
        T t = null;
        if (!TextUtils.isEmpty(s)) {
            t = gson.fromJson(s, cls);
        }
        return t;
    }
}
